﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AIVOnline.TopologyModel.PathModel
{
    /// <summary>
    /// 点位状态----经常更新状态的表
    /// </summary>
    [Table("AIVNodeState")]
    public class AIVNodeState
    {
        /// <summary>
        /// 点位编号
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]       // 不自增字段
        public int NodeId { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public NodeState State { get; set; } = NodeState.Normal;

        /// <summary>
        /// 被预约时，
        /// </summary>
        public String Owner { get; set; } = string.Empty;
    }


    public enum NodeState
    {
        /// <summary>
        /// 不存在/不使用
        /// </summary>
        NoExist = 0,
        NonUsed = 0,

        /// <summary>
        /// 正常可用--通畅
        /// </summary>
        Normal = 1,


        /// <summary>
        /// 预定保留 
        /// -- 有任务要通过该点； 或者有物品要使用该点， 但还未到达占用。
        /// </summary>
        Reserved = 2,

        /// <summary>
        /// 已被占用。
        /// </summary>
        Occupied = 4,
    }

}
